package com.nothingboard.admin.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.nothingboard.common.data.request.GlobalVariables;
import com.nothingboard.module.code.service.CodeService;
import com.nothingboard.module.site.service.SiteConfigService;

public class DefaultInterceptor extends HandlerInterceptorAdapter {
	
	@Autowired
	private SiteConfigService siteConfigService;
	
	private static final Logger logger = LoggerFactory.getLogger(DefaultInterceptor.class);

	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {

	//	String domain = request.getLocalName();
	//	request.setAttribute(GlobalVariables.SITE_CONFIG, siteConfigService.getSiteConfig(domain));

		return true;
	}

	@Override
	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {

	}
	
	@Override
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex) throws Exception {

	}

}
